<?php

namespace App\Http\Controllers\queue;
use App\Models\Api\Queue;
use Illuminate\Support\Facades\Log;
use function Matrix\identity;

class Consumer
{
    public function insert($className,$functionName,$args,$exec_time){

        $data = Queue::create(array(
            'class_name'=>$className,
            'function_name'=>$functionName,
            'args'=>json_encode($args),
        ));
        $data->value = time()+random_int(1,111);
        $data->save();
        return $data->id;
    }
}